Handle optional field types#71
Merged
alexcrocha merged 1 commit intoar-rust-rbs-buildfrom Dec 16, 2025
Merged
Conversation
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
9f9a5f6 to
617d70a
Compare
8718771 to
b8eeab8
Compare
Base automatically changed from
12-08-annotate_nullable_pointer_fields_in_config.yml_with_optional_true
to
ar-rust-rbs-build
December 15, 2025 18:36
b8eeab8 to
2b0936c
Compare
Merged
vinistock
approved these changes
Dec 16, 2025
st0012
approved these changes
Dec 16, 2025
2b0936c to
0934030
Compare
alexcrocha
added a commit
that referenced
this pull request
Jan 13, 2026
Read `optional: true` annotations from `config.yml` and generate `Option<T>` return types with null checks, so we don't crash at runtime. The extracted helper function centralizes the accessor generation logic for pointer-based field types.
alexcrocha
added a commit
that referenced
this pull request
Jan 13, 2026
Read `optional: true` annotations from `config.yml` and generate `Option<T>` return types with null checks, so we don't crash at runtime. The extracted helper function centralizes the accessor generation logic for pointer-based field types.
alexcrocha
added a commit
that referenced
this pull request
Jan 14, 2026
Read `optional: true` annotations from `config.yml` and generate `Option<T>` return types with null checks, so we don't crash at runtime. The extracted helper function centralizes the accessor generation logic for pointer-based field types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Now that we have
optional: trueannotations inconfig.yml, we can leverage them to check if fields are optional.This PR updates the codegen to read those annotations and generate
Option<T>return types with null checks, so we don't crash at runtime.Also refactored the accessor generation to reduce duplication by extracting a helper function for the common pattern.
This enables implementing correct AST visitor traversal in a follow-up PR.